from selenium import webdriver

class utils:

    tmp = None

    # 获取浏览器驱动对象，并进行tpshop网址请求
    @classmethod
    def get_tp(cls):
        if cls.tmp is None:
            cls.tmp = webdriver.Edge()
            cls.tmp.maximize_window()
            cls.tmp.get("http://localhost:81/index.php")
        return cls.tmp

    #进行退出操作
    @classmethod
    def quit_tp(cls):
        if cls.tmp != None:
            cls.get_tp().quit()
            cls.tmp = None